#include<iostream>
#include<queue>
using namespace std;
typedef long long ll;
int main()
{
    ll n, k;
    cin >> n >> k;

    priority_queue<ll> heap;
    ll val, sum = 0;
    while (n--)
    {
        cin >> val;
        sum += val;
        if (val % 2 == 0) heap.push(val);
    }

    while (!heap.empty() && k--)
    {
        ll t = heap.top() / 2;
        sum -= t;
        heap.pop();
        if (t % 2 == 0) heap.push(t);
    }

    cout << sum << endl;

    return 0;

}